package base;

import java.util.Iterator;
import java.util.Vector;

/**
 * the class which can save all orders.
 */

public class Sale {
    //to save all orders.
    private Vector<Order> orders = new Vector<Order>();

    /**
     * to add the order to the list.
     */
    public void addOrder(Order order) {
        this.orders.add(order);
    }

    /**
     * return the number of orders which are saved in the list.
     */
    public int getNumberOfOrders() {
        return this.orders.size();
    }

    /**
     * Returns an iterator over the items in this orders.
     *
     * return  an {@link Iterator}
     */
    public Iterator<Order> getItemsIterator() {
        return orders.iterator();
    }

}